package com.fare.taluo.fetl.domain.entity.history;

import java.util.Date;
import java.util.List;

import com.dayatang.domain.InstanceFactory;
import com.fare.taluo.base.ddd.domain.BaseHBaseEntity;
import com.fare.taluo.fetl.domain.repository.history.ISinglePlaneInfoHistoryRepository;
import com.fare.taluo.vo.core.PlaneInfo;
/**
 * 单程历史数据表<br/>
 * hbase表rowkey=20000CANCTU20140404201404040700ZH9673
 * 渠道hbasekey[5位]出发城市三字码[3位]到达城市三字码[3位]抓取时间[8位yyyyMMdd]
 *  航班时间[10位yyyyMMddHH]航班号[8位，不足则左侧补0]
 * @author xingsf 2014-04-04
 *
 */
public class SinglePlaneInfoHistoryEntity extends BaseHBaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5400017165601550202L;

	public ISinglePlaneInfoHistoryRepository getSinglePlaneInfoHistoryRepository() {
		return InstanceFactory.getInstance(ISinglePlaneInfoHistoryRepository.class);
	}
	
	@Override
	public String generateRowKey() {
		return null;
	}
	/**
	 * 获得历史航班价格数据,航线下的全部航班
	 * @param crawlDate
	 * @param hbaseKey
	 * @param fromCode
	 * @param toCode
	 * @param flightDate
	 * @return
	 * @throws Exception
	 */
	public List<PlaneInfo> list(Date crawlDate, String hbaseKey, String fromCode,
			String toCode, Date flightDate) throws Exception{
		return getSinglePlaneInfoHistoryRepository().find(crawlDate, hbaseKey, fromCode, toCode, flightDate);
	}
	/**
	 * 获得历史航班价格数据 ,航线下的指定航班
	 * @param crawlDate
	 * @param hbaseKey
	 * @param fromCode
	 * @param toCode
	 * @param flightDate
	 * @return
	 * @throws Exception
	 */
	public PlaneInfo find(Date crawlDate, String hbaseKey, 
			String fromCode, String toCode, Date flightDate, String flightNo) throws Exception{
		return getSinglePlaneInfoHistoryRepository().find(crawlDate, hbaseKey, fromCode, toCode, flightDate,flightNo);
	}
}
